<!doctype html>
<html>
<head>
    <meta charset="UTF-8">
    <title>WorkPort</title>
    <link rel="stylesheet" type="text/css" href="../lib/kendo/styles/kendo.common-bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../lib/kendo/styles/kendo.bootstrap.min.css">
    <link rel="stylesheet" type="text/css" href="../css/style.css">
    <link rel="stylesheet" type="text/css" href="../css/layout.css">
    <script src="../lib/kendo/js/jquery.min.js"></script>
    <script src="../lib/kendo/js/kendo.all.min.js"></script>
    <script src="../lib/kendo/js/jquery.transit.min.js"></script>
    <script src="../lib/jquery.slimscroll.min.js"></script>
    <script src="../js/svs.framework.js"></script>
    <script src="../js/wp.js"></script>
    <script src="../js/doc.api.js"></script>
</head>

<body>
    <script type="text/javascript">
    function self(){
    	Workport.DocumentAPI.getSelf(function(data){    		
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{pageSize:10,offset:'3/29/2014 5:31 PM',order: true,filter: 'Time'});
    }
    function mash(){
    	Workport.DocumentAPI.getAll(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{pageSize:10,order:true,sinceid:3,filter:'Time',order:true,key:"A"});
    }
    function detail(){
    	Workport.DocumentAPI.getDetail(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{documentId:7,type: 'C',targetId: '20145971540211'});
    }
    function search(){
    	Workport.DocumentAPI.search(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{key:'A',entity:'U',pageSize:10});
    }
    function community(){
    	Workport.DocumentAPI.getCommunity(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{pageSize:10,offset:'7/4/2014 9:47:16 AM',communityId:'20145971540211'});
    }
    function checkin(){
    	Workport.DocumentAPI.checkin(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{notificationId:'U_201452673919825',notificationType:'C',documentId: 7,targetId: '20145971540211',comments:'TEST Check in',documentContent:'QEBA',version:'0.4'});
    }
    function checkout(){
    	Workport.DocumentAPI.checkout(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{notificationId:"U_201452673919825",notificationType:'C',documentId:7,targetId:'20145971540211'});
    }
    function discard(){
    	Workport.DocumentAPI.discard(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{notificationId:"U_201452673919825",notificationType:'c',documentId:7,targetId:'20145971540211'});
    }
    function ver(){
    	Workport.DocumentAPI.getVersion(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{type:'C',targetId:'20145971540211',documentId:7});
    }
    function copy(){
    	Workport.DocumentAPI.copy(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{targetId:"samplestring1",tags:"samplestring2",entityId:"samplestring3",entityType:"samplestring4",
    		communityId:"samplestring5",attachmentName:"samplestring1",attachmentType:"samplestring2",attachmentContent:"QEBA"});
    }
    function restore(){
    	Workport.DocumentAPI.restore(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{documentId:7,version:'0.1',type:'C',targetId:'20145971540211'});
    }
    function copyto(){
    	Workport.DocumentAPI.copyto(function(data){
    		$('#result').get(0).innerText += (new Date() + ":" + JSON.stringify(data) + "\n");
    	},{documentId:7,version:'0.1',type:'C',src:'20145971540211',dest:'2014512999862'});
    }
    function clearLog(){
    	$('#result').get(0).innerText = "";
    }
    </script>
    
</body>
	<input type = "button" onclick = "clearLog()" value="Clear"></br>
	<input type = "button" onclick = "self()" value="Self">
	<input type = "button" onclick = "mash()" value="All">
	<input type = "button" onclick = "detail()" value="Detail">
	<input type = "button" onclick = "search()" value="Search">
	<input type = "button" onclick = "community()" value="Community">
	<input type = "button" onclick = "checkin()" value="CheckIn">
	<input type = "button" onclick = "checkout()" value="CheckOut">
	<input type = "button" onclick = "discard()" value="Discard">
	<input type = "button" onclick = "ver()" value="Version">
	<input type = "button" onclick = "copy()" value="Copy">
	<input type = "button" onclick = "restore()" value="Restore">
	<input type = "button" onclick = "copyto()" value="CopyTo">
	</br>
	
	<div id="result" style="margin: 0px;"></div>
	
</html>